<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>DOM方法学习</title>
</head>
<body>
<p>
    createElement,createTextNode,appendChild,insertBefore
</p>
<span>
    insertBefore()    parentElement.insertBefore(new,target);
</span>
<div id="oDiv">
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
    </ul>
</div>
<script src="dom.js" type="text/javascript"></script>
<script>
    var objDiv = document.getElementById('oDiv');
    objDiv.removeChild(objDiv.childNodes[1]);
    console.log(objDiv.childNodes);
    res = convertToArray(objDiv.childNodes);
//    console.log(objDiv.lastChild);

    for(var i= 0,len=res.length;i<len;i++)
    {
//        objDiv.removeChild(objDiv.lastChild);
        console.log(res[i].nodeType);
    }
    console.log(isArray(res));
</script>
</body>
</html>